#include <gtk/gtk.h>
#include <stdio.h>

int main(void)
{
    const char *dpy_name = ":1";
    gtk_init();
    GdkDisplay *dpy1 = gdk_display_get_default();
    GdkDisplay *dpy2 = gdk_display_get_default();
    GdkDisplay *dpy3 = gdk_display_open(dpy_name);
    GdkDisplay *dpy4 = gdk_display_open(dpy_name);
    printf("dpy1:%p, dpy2:%p, dpy3:%p, dpy4:%p\n", dpy1, dpy2, dpy3, dpy4);
    auto loop = g_main_loop_new(NULL, FALSE);
    g_timeout_add(10000, GSourceFunc(g_main_loop_quit), loop);
    g_main_loop_run(loop);
    gdk_display_close(dpy1);
    gdk_display_close(dpy2);
    gdk_display_close(dpy3);
    gdk_display_close(dpy4);
    return 0;
    
}
